package com.reliable.service.serviceimpl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.reliable.service.mapper.ReliableTaskMapper;
import com.reliable.service.domain.ReliableTask;
import com.reliable.service.service.IReliableTaskService;

/**
 * 任务Service业务层处理
 *
 * @author ruoyi
 * @date 2025-07-09
 */
@Service
public class ReliableTaskServiceImpl extends ServiceImpl<ReliableTaskMapper, ReliableTask> implements IReliableTaskService {

    @Autowired
    private ReliableTaskMapper reliableTaskMapper;

    /**
     * 查询任务
     *
     * @param id 任务主键
     * @return 任务
     */
    @Override
    public ReliableTask selectReliableTaskById(Long id) {
        return reliableTaskMapper.selectById(id);
    }

    /**
     * 查询任务列表
     *
     * @param reliableTask 任务
     * @return 任务
     */
    @Override
    public List<ReliableTask> selectReliableTaskList(ReliableTask reliableTask) {
        return reliableTaskMapper.selectReliableTaskList(reliableTask);
    }

    /**
     * 新增任务
     *
     * @param reliableTask 任务
     * @return 结果
     */
    @Override
    public int insertReliableTask(ReliableTask reliableTask) {
        return reliableTaskMapper.insert(reliableTask);
    }

    /**
     * 修改任务
     *
     * @param reliableTask 任务
     * @return 结果
     */
    @Override
    public int updateReliableTask(ReliableTask reliableTask) {
        return reliableTaskMapper.updateById(reliableTask);
    }

    /**
     * 批量删除任务
     *
     * @param ids 需要删除的任务主键
     * @return 结果
     */
    @Override
    public int deleteReliableTaskByIds(Long[] ids) {
        return reliableTaskMapper.deleteBatchIds(java.util.Arrays.asList(ids));
    }

    /**
     * 删除任务信息
     *
     * @param id 任务主键
     * @return 结果
     */
    @Override
    public int deleteReliableTaskById(Long id) {
        return reliableTaskMapper.deleteById(id);
    }
}